package com.yupi.springbootinit.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.springbootinit.model.dto.team.TeamJoinRequest;
import com.yupi.springbootinit.model.dto.team.TeamQuery;
import com.yupi.springbootinit.model.dto.team.TeamQuitRequest;
import com.yupi.springbootinit.model.dto.team.TeamUpdateRequest;
import com.yupi.springbootinit.model.entity.Team;
import com.yupi.springbootinit.model.entity.User;
import com.yupi.springbootinit.model.vo.TeamVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author junjun
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2023-05-26 10:05:51
*/
public interface TeamService extends IService<Team> {

    long addTeam(Team team, User loginUser);

    /**
     * 搜索队伍
     * @param teamQuery
     * @param request
     * @return
     */
    List<TeamVO> listTeams(TeamQuery teamQuery, HttpServletRequest request);

    Boolean updateTeam(TeamUpdateRequest teamUpdateRequest, HttpServletRequest request);

    boolean joinTeam(TeamJoinRequest teamJoinRequest, HttpServletRequest request);

    boolean quitTeam(TeamQuitRequest teamQuitRequest, HttpServletRequest httpServletRequest);

    boolean dismissTeam(TeamQuitRequest teamQuitRequest, HttpServletRequest request);

    List<TeamVO> listTeamJoined( HttpServletRequest request);

    List<TeamVO> listTeamCreated(HttpServletRequest request);
}
